
let info = document.querySelector(".info")



// 获取优惠券数据 
let couponid = getQueryString("couponid")

req(couponid)

/* 获取优惠券 */
function req(couponid) {
    fetch("http://chst.vip:1234/api/getcouponproduct?couponid=" + couponid)
        .then(response => response.json())
        .then(res => {
            let domStr = ''
            res.result.forEach(item => {
                domStr += `
                <li data-index=${item.couponProductId}>
                    <a href="javascript:;" class="clearfix">
                        <div class="img fl">
                           ${item.couponProductImg}
                        </div>
                        <div class="infoR">
                            <div class="title">
                                <h4>${item.couponProductName}</h4>
                            </div>
                            <div class="other">
                                <h4 class="price">
                                   ${item.couponProductPrice}
                                </h4>
                                <div class="mall fl">有效期至10月31日</div>
                            </div>

                        </div>
                    </a>
                </li>`
            })
            info.innerHTML = domStr
        })
}

